package com.hsnn.medstgmini.pro.base.service.Impl;

import java.util.Map;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hsnn.medstgmini.pro.base.dao.BakpurchaseDao;
import com.hsnn.medstgmini.pro.base.dao.BaseGoodsDao;
import com.hsnn.medstgmini.pro.base.model.BaseBakpurchase;
import com.hsnn.medstgmini.pro.base.service.BakpurchaseManager;
import com.hsnn.medstgmini.sys.model.SysUser;
import com.hsnn.medstgmini.trading.catalog.dao.PurHospCatalogDao;
import com.hsnn.medstgmini.util.Pagination;

/**
 * @category 配送企业目录管理 接口实现类
 * @author 陈镜宇
 * @date 2015年6月15日
 */
@Service
public class BakpurchaseManagerImpl implements BakpurchaseManager {
	@Autowired
	private BakpurchaseDao bakpurchaseDao;

	@Autowired
	private BaseGoodsDao baseGoodsDao;

	@Autowired
	private PurHospCatalogDao purHospCatalogDao;

	@Override
	public Pagination getAddList(Pagination page) {
		return bakpurchaseDao.getAddList(page);
	}

	@Override
	public Object getDrugInfo(String drugCode) {
		return bakpurchaseDao.getDrugInfo(drugCode);
	}

	@Override
	public Pagination getCompList(Pagination page) {
		return bakpurchaseDao.getCompList(page);
	}

	@Override
	@Transactional
	public void submitFiling(BaseBakpurchase bak, SysUser user) {
		bakpurchaseDao.submitFiling(bak, user);

	}

	@Override
	public Pagination getBakDurgList(Pagination page) {
		return bakpurchaseDao.getBakDurgList(page);
	}

	@Override
	public Object getBakById(String cid) {
		return bakpurchaseDao.getBakById(cid);
	}

	public Object getBakDrugById(String bakDrugId) {
		return bakpurchaseDao.getBakDrugById(bakDrugId);
	}

	public void update(BaseBakpurchase baseBakpurchase) {
		bakpurchaseDao.update(baseBakpurchase);
	}

	@Override
	@Transactional
	public void auditBak(BaseBakpurchase bak, SysUser user, Map<String, Object> detail) {
		bakpurchaseDao.auditBak(bak, user, detail);
	}
	
	/**
	 * @category 卫生局审核备案
	 * @date 2015年11月21日
	 * @param bak
	 * @param user
	 */
	@Transactional
	public void wsjAuditBak(BaseBakpurchase bak, SysUser user) {
		bakpurchaseDao.wsjAuditBak(bak, user);
	}
	
}